package com.tedu.bill;

import java.util.zip.CheckedOutputStream;

/**
 * Author：毕龙
 * Date: 2024/3/17 10:31
 */
public class TestChar {
    public static void main(String[] args) {
        //声明一个字符
        char c1 = 'A';
        //太多的字符在字符字面值上
        //Too many characters in character literal
        //char c1 = 'AB';
        System.out.println(c1);

        //第二种方式 ASCII
        char c2 = 65;
        System.out.println(c2);//A
        //第三种  Unicode  16进制的数字
        char c3 = '\u0041';
        System.out.println(c3);

        //类型互换
        int i1 = c2;
        System.out.println(i1);//65
       // char c4 = i1;
       // System.out.println(c4);
        //  精度损失  0-65535   32767
        //short s1 = c3;
        short s2 = 123;
        //short有负数 char没有负数
        //c3 = s2;


        char c5 = '\u6211';
        System.out.println(c5);
        char c6 = '\u7231';
        System.out.println(c6);
        char c7 = '\u4f60';
        System.out.println(c7);

        int i2 = c5;
        int i3 = c6;
        int i4 = c7;
        System.out.println(i2+","+i3+","+i4);
    }
}
